﻿namespace MicroCloud.Authorization
{
    /// <summary>
    /// 权限服务接口
    /// </summary>
    public interface IAuthorityService
    {
        /// <summary>
        /// 获取指定用户已授权模块信息
        /// </summary>
        /// <param name="principal">在线用户信息</param>
        /// <returns>模块信息集合</returns>
        List<ModuleInfo> GetAuthorizedInfosByUser(IPrincipal principal = null);

        /// <summary>
        /// 获取指定用户已授权模块信息
        /// </summary>
        /// <param name="userId">用户编号</param>
        /// <returns>模块信息集合</returns>
        List<ModuleInfo> GetAuthorizedInfosByUser(string userId);

        /// <summary>
        /// 获取指定角色已授权模块信息
        /// </summary>
        /// <param name="roleId">角色编号</param>
        /// <returns>模块信息集合</returns>
        List<ModuleInfo> GetAuthorizedInfosByRole(string roleId);

    }
}
